import request from '@/utils/request'

export const inferenceApi = {
  // 单文件推理
  runInference: (inputData) =>
    request({
      url: '/inference',
      method: 'post',
      data: inputData
    }),

  // 多文件推理
  runInferenceBatch: (inputData) =>
    request({
      url: '/inferenceBatch',
      method: 'post',
      data: inputData
    }),

  // 难辨别样本上传
  updateSamplesAPI: (inputData) =>
    request({
      url: '/updateSamples',
      method: 'post',
      data: inputData
    }),

  // 云侧模型增量学习
  couldEvolutionApi: (inputData) =>
    request({
      url: '/couldEvolution',
      method: 'post',
      data: inputData
    }),

  // 云边分布式协同进化
  collaborateEvolutionApi: (inputData) =>
    request({
      url: '/CollaborateEvolution',
      method: 'post',
      data: inputData
    }),

  // 获取任务进度
  getTaskProgress: (taskID) =>
    request({
      url: '/taskProgress',
      method: 'post',
      data: { taskID }
    }),

  // 云边协同策略配置
  setStrategy: (inputData) =>
    request({
      url: '/strategy',
      method: 'post',
      data: inputData
    }),

  // 获取推理数据
  getFileByPath: (filePath) =>
    request({
      url: '/getFileByPath',
      method: 'post',
      data: { filePath }
    }),

  // 获取 GPU 显存使用情况
  getGPUStatusInfo: () =>
    request({
      url: '/gpustatus',
      method: 'post',
      data: {}
    }),

  // 获取 CPU 利用率和内存使用情况
  getCPUStatusInfo: () =>
    request({
      url: '/cpustatus',
      method: 'post',
      data: {}
    }),

  // 获取网络带宽情况
  getNetworkStatusInfo: () =>
    request({
      url: '/networkstatus',
      method: 'post',
      data: {}
    })
}
